package com.qg.service;

import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import pojo.User;

import java.util.Map;

@Component
@RestController
public class UserService {
    /*传单个或多个变量*/
//    @RequestMapping(value = "/Login",method = RequestMethod.GET)
//    public String Login(@RequestParam("userName") String userName){
//        return "登录成功!欢迎你:"+userName;
//    }
    /*传对象*/
//    @RequestMapping(value = "/Login",method = RequestMethod.POST)
//    public String Login(@RequestBody User user){
//        return "登录成功!欢迎你:"+user.getUserName();
//    }
    /*传Map集合*/
    @RequestMapping(value = "/Login",method = RequestMethod.POST)
    public String Login(@RequestParam Map<String,Object> param) {
        return "登录成功!欢迎你:" + param.get("userName");
    }
}
